<%@ page language="java" pageEncoding="utf-8"
		 contentType="text/html;charset=utf-8"%>
<html>

<%@ include file="../../../common/jstl.jsp"%>
<head>
</head>

<body>

<div id="addForm" class="mgt40">
	<form action="${ctx }/link/ajax/save" id="editForm" method="post">
		<input type="hidden" name="id" value="${friendShipLink.id }"/>
		<div class="">
			<div class="J_formTable l_form_table">
				<table class="not_hightlight">
					<tr>
						<td class="l_title w200"><b class="cRed">*</b> 站点名称:</td>
						<td>
							<div class="J_toolsBar fl">
								<div class="t_text w200 ml10">
									<label>
										<input type="text" name="siteName" maxlength="32" value="${friendShipLink.siteName }"/>
									</label>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td class="l_title w200"><b class="cRed">*</b> 站点链接:</td>
						<td>
							<div class="J_toolsBar fl">
								<div class="t_text w200 ml10">
									<label>
										<input type="text" name="link" maxlength="32" value="${friendShipLink.link }"/>
									</label>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	var parentChosen;

	//表单验证
	$(function(){

		parentChosen = $(".chosen-select").chosen({
			no_results_text: "未找到父栏目",
			width : '100%'
		});

		$('#editForm').validator({
			ignore: ':hidden',
			fields : {
				code : '栏目编码:required;length[~20]',
				name : '栏目名称:required;length[~32]',
				orderNo : '序号:integer[+]',
				columnLevel : '栏目层级:required;',
				parentId : '父栏目:required;'
			},
			valid : function(form){
				var laodIdx = layer.load();

				$('#editForm').ajaxSubmit({
					data : {
					},
					traditional : true,
					success : function(result){
						layer.close(laodIdx);
						if(result.success){
							layer.alert('保存成功', function(){
								window.location.reload();
							});
						}else{
							layer.alert(result.msg);
						}
					}
				});
			}
		});






	});
</script>
</body>
</html>